package com.leyuangame.core.websocket;

import com.leyuangame.core.BMDataContext;
import com.leyuangame.core.async.MatchTask;
import com.leyuangame.core.websocket.handler.GameEventHandler;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.stereotype.Component;

@Component
public class ServerRunner implements CommandLineRunner {
    @Autowired
    private MatchTask matchTask;
    @Autowired
    private final GameServer server;
    @Autowired
    public ServerRunner(GameServer server) {  
        this.server = server;  
    }
    
    public void run(String... args) throws Exception { 
        server.start();//websocket 开启
//        matchTask.start();//匹配线程开启
        BMDataContext.setIMServerStatus(true);	//IMServer 启动成功
    }

}